home *** CD-ROM | disk | FTP | other *** search
/ Aminet 39 / Aminet 39 (2000)(Schatztruhe)[!][Oct 2000].iso / Aminet / util / misc / ReqAttackUpd.lha / ReqAttackUpd / ReqOFF-Bonus / kernelchange.e next >
Encoding:
Text File  |  1992-07-15  |  1.4 KB  |  26 lines

  1. /* Here's a very simple example on how to write ReqOFF requester replacers.
  2.    It calls EasyRequestArgs and after the 'Terminate' button was pressed
  3.    it sets the variable "kernel" to "WarpUP".
  4.  
  5.    IMPORTANT: To protect ReqOFF againts going into infinitive loop (when your
  6.    requester replacer calls EasyRequestArgs() with same TITLE and/or TEXT
  7.    as the original requester) you should add a single space as a first byte
  8.    of title string, or simply change it to other title which will not qualify
  9.    to be patched by your program again and again and again...
  10.  
  11.    IMPORTANT: In 'replacerdata' structure you receive not only the easystruc,
  12.    but also the screen pointer, idcmp and args with which the main
  13.    EasyRequestArgs was called. The 1st thing is that is not guaranteed that the
  14.    screen is still opened (I think it's better to call EasyRequestArgs() with
  15.    a NIL/NULL screen pointer because all users probably use DefaultPubScreen
  16.    patches). The 2nd is that idcmp and args may be passed incorrectly by
  17.    ReqOFF/other software (???) because mine programs hanged with these args
  18.    passed to EasyRequestArgs - so don't use them!
  19. */
  20.  
  21. DEF exit
  22. PROC main()
  23.   exit:=EasyRequestArgs(0,[20,0,'Kernel termination','Sure to terminate PowerUP?\nYou won\at be able to restart\nthis kernel without rebooting!','WarpUP|Cancel'],0,0)
  24.   IF exit=1;Execute('setenv kernel WarpUP',0,0);ENDIF
  25. ENDPROC exit
  26.